.profile-container {
    max-width: 500px;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin: 1.5rem auto; /* 水平居中 */
}

/* 添加父容器样式确保垂直居中 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 主内容区域 */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 1rem;
}

.profile-container h1 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

.profile-form {
    margin-bottom: 2.5rem;
    display: flex; /* 添加flex显示 */
    flex-direction: column;
    gap: 10px;
}

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: #444;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0069d9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: #007bff;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #d0d0d0;
}

.profile-stats {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 2rem;
}

.profile-stats h3 {
    margin-top: 0;
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.profile-stats p {
    margin: 0.8rem 0;
    color: #666;
    font-size: 0.95rem;
}

.flash-messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #888;
}

@media (max-width: 576px) {
    .profile-container {
        padding: 1.2rem;
        margin: 1rem;
        border-radius: 10px;
    }

    .profile-container h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-group input {
        padding: 0.8rem;
    }

    .main-content {
        padding: 0.5rem;
        align-items: flex-start; /* 小屏幕上顶部对齐 */
    }

    .btn {
        padding: 0.9rem;
    }
}

@media (max-width: 400px) {
    .profile-container {
        padding: 1rem;
        margin: 0.5rem;
        box-shadow: none;
        border: 1px solid #e0e0e0;
    }
}